var app = getApp()

function getHomeInfo(type, callback) {
    app.func.Get(false, app.api.homeInfo, {"period_type": type}, function (res) {
        typeof callback == "function" && callback(res)
    })
}

function getRule(type, callback) {
    app.func.Get(false, app.api.getRule, {period_type: type}, function (res) {
        typeof callback == "function" && callback(res)
    })
}

function getMyPassword(type, id, callback) {
    app.func.Get(false, app.api.myPassword, {period_type: type, period_id: id}, function (res) {
        typeof callback == "function" && callback(res)
    })
}

function getPasswordRecord(type, page, callback) {
    app.func.Get(false, app.api.passwordRecord, {period_type: type, page: page}, function (res) {
        typeof callback == "function" && callback(res)
    })
}

function getWinInfo(type, callback) {
    app.func.Get(false, app.api.win_info, {"period_type": type}, function (res) {
        typeof callback == "function" && callback(res)
    })
}

function getBattleAwards(type, callback) {
    app.func.Get(false, app.api.battleAwards, {"period_type": type}, function (res) {
        typeof callback == "function" && callback(res)
    })
}

module.exports = {
    getHomeInfo: getHomeInfo,
    getRule: getRule,
    getMyPassword: getMyPassword,
    getPasswordRecord: getPasswordRecord,
    getWinInfo: getWinInfo,
    getBattleAwards: getBattleAwards
};